<template>
    <span class="dialog-footer">
        <el-button @click="handleDialog">取 消</el-button>
        <el-button type="primary" @click="handleAffirm">确 定</el-button>
    </span>
</template>
<script type="text/javascript">
// import empty from './empty.vue'
export default {
    components: {
        //empty
    },
    props: {
        value: [Boolean],
        default: false
    },
    data() {
        return {

        }
    },
    /**
     * 计算属性
     * @type {Object}
     */
    computed: {
        closed() {
            return this.$parent.closed;
        }
    },
    /**
     * 数据监听
     * @type {Object}
     */
    watch: {
        closed(value) {
            if (value) {
                this.handleDialog()
            }
        }
    },
    mounted() {
        console.log("this腹肌", this)
    },
    /**
     * 页面方法
     * @type {Object}
     */
    methods: {
        handleDialog() {
            this.$parent.visible = false
        },
        handleAffirm() {
            if (this.$parent.$children[0].handleAffirm) {
                this.$parent.$children[0].handleAffirm(this);
                this.handleDialog();
            } else {
                console.log("事件不存在");
            }
        }
    }
}
</script>
<style type="text/css" lang="scss">
</style>